package com.example.beidouapplication;

import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;

import androidx.annotation.Nullable;

import com.example.beidouapplication.viewmodel.Key;
import com.example.beidouapplication.viewmodel.KeyEvent;


public class FragmentSysParaInfoSet extends Fragment {

    Button btn;
    EditText input;


    static FragmentSysParaInfoSet instance = new FragmentSysParaInfoSet();

    @Override
    public View onCreateView(
            LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState
    ) {

        View inflate = inflater.inflate(R.layout.fragment_sys_para_info_set, container, false);
        return inflate;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        input =  getActivity().findViewById(R.id.btn_SysParaInfoSet_row2);
        btn = getActivity().findViewById(R.id.btn_SysParaInfoSet_row3);
        btn.setOnClickListener(v -> {

            String pwd = input.getText().toString();
            KeyEvent e = new KeyEvent(Key.ENTER, -1);
            e.extra.put("pwd", pwd);
            Menu.keyQueue.add(e);
            input.getText().clear();
        });

    }


}